package com.basic.technology.study.introduction.exception;

/**
 * @Description
 * @Author 程杰
 * @Date 2020/11/6 15:58
 * @Version 1.0
 */
public class ExceptionDemo2 {
    public static void main(String[] args) {
        try {
            int a = args.length;
            System.out.println("a = " + a);
            int b = 42 / a;
            int[] c= { 1 };
            c[42] = 99;
        } catch(ArithmeticException e) {
            System.out.println("Divide by 0: " + e);
        } catch(ArrayIndexOutOfBoundsException e) {
            System.out.println("Array index oob: " + e);
        }
        System.out.println("After try/catch blocks.");
    }
}
